package com.smartscreen.schedulemanage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartscreen.schedulemanage.entity.TimetableSession;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TimetableMapper extends BaseMapper<TimetableSession> {
    
    @Select("SELECT * FROM timetable_session " +
            "WHERE class_id = #{classId} AND term_id = #{termId} " +
            "ORDER BY day_of_week, session_number")
    List<TimetableSession> getClassTimetable(@Param("classId") String classId, @Param("termId") String termId);
    
    @Select("SELECT * FROM timetable_session " +
            "WHERE teacher_id = #{teacherId} AND term_id = #{termId} " +
            "ORDER BY day_of_week, session_number")
    List<TimetableSession> getTeacherTimetable(@Param("teacherId") String teacherId, @Param("termId") String termId);
}